import { xhrPostJson } from '@/services';
import { DynamicObjectAny } from '@/typings';

const bpmUrl = '/bpm';
const baseUrl = '/arcv';

const api = {
  delete: `${baseUrl}/arcvBrwr/delete`,
  detail: `${baseUrl}/arcvBrwr/detail`,
  list: `${baseUrl}/arcvBrwr/list`,
  page: `${baseUrl}/arcvBrwr/page`,
  tree: `${baseUrl}/arcvBrwr/tree`,
  create: `${baseUrl}/arcvBrwr/save`,
  update: `${baseUrl}/arcvBrwr/update`,
  lend: `${baseUrl}/arcvBrwr/lend`,
  giveBack: `${baseUrl}/arcvBrwr/giveBack`,
  findPrcsByPrcsInstId: `${bpmUrl}/prcsDeploy/findPrcsByPrcsInstId`, // 获取流程图
  comment: `${bpmUrl}/task/comment`, // 历史记录
};

// 借出
export const arcvBrwrLend = (params: DynamicObjectAny) => {
  return xhrPostJson(api.lend, params);
};
// 归还
export const arcvBrwrGiveBack = (params: DynamicObjectAny) => {
  return xhrPostJson(api.giveBack, params);
};

export default api;
